//
//  DSMainTabBarContoller.swift
//  Dss_Swift
//
//  Created by Steve on 2021/2/27.
//

import UIKit
import ESTabBarController_swift

class DSMainTabBarContoller: ESTabBarController {

    override func viewDidLoad() {
        super.viewDidLoad()
        setup()
    }
    
    override func viewWillAppear(_ animated: Bool) {
         super.viewWillAppear(animated)
         view.frame = UIScreen.main.bounds
     }
    
    

    private func setup(){
        view.backgroundColor = .white
        
        self.delegate = delegate

        let v1 = DSWorkbench()
         let v2 = DSNewsVC()
         let v3 = DSCustomerVC()
         let v4 = DSNewsVC()
         let v5 = DSMeVC()
         
         v1.tabBarItem = ESTabBarItem.init(ExampleIrregularityBasicContentView(), title: "首页", image: UIImage(named: "index-out"), selectedImage: UIImage(named: "index-in"))
         v2.tabBarItem = ESTabBarItem.init(ExampleIrregularityBasicContentView(), title: "商城", image: UIImage(named: "list-out"), selectedImage: UIImage(named: "list-out"))
         v3.tabBarItem = ESTabBarItem.init(ExampleIrregularityContentView(), title: nil, image: UIImage(named: "photo_verybig"), selectedImage: UIImage(named: "photo_verybig"))
         v4.tabBarItem = ESTabBarItem.init(ExampleIrregularityBasicContentView(), title: "消息", image: UIImage(named: "find_out"), selectedImage: UIImage(named: "find_in"))
         v5.tabBarItem = ESTabBarItem.init(ExampleIrregularityBasicContentView(), title: "我的", image: UIImage(named: "mine-out"), selectedImage: UIImage(named: "mine-in"))
         
         viewControllers = [NavigationController(v1),
                            NavigationController(v2),
                            NavigationController(v3),
                            NavigationController(v4),
                            NavigationController(v5)]
    }

}
